<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
    <textarea cols="22" rows="4" id="account" name="account"></textarea>
    <input id="sub" type="submit"  value="OK">
    
    <script type="text/javascript">
    window.onload = function(){
        document.getElementById('sub').onclick = function(){
        	var acc = document.getElementById('account')
            var val = acc.value
           // alert(val);
            var ar = val.split('\n')
            //alert(ar);
            var exgexEmail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
            for(var i = 0; i < ar.length; i++){
                var a = ar[i];
                if (a && a.search(exgexEmail) == -1){
                    alert('invalidate');
                    return;
                }
            }
            alert('OK');
        }
    }
    </script>
</body>
</html>